//Copyright 2010 Balazs Keri, Imre Keri
//
//This file is part of FireworksCreator.
//
//FireworksCreator is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//FireworksCreator is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with FireworksCreator.  If not, see <http://www.gnu.org/licenses/>.
//
#include "mainview.h"
#include "objectpage.h"
#include "viewattributegroup.h"
#include "viewattributes.h"
//
ObjectPage::ObjectPage(MainView *p_main_view,QWidget *p_parent)
:
   QWidget(p_parent),
   attr_group(new ViewAttributeGroup(p_main_view->get_document()))
{
   new ViewAttributeType::ModelDataObject(attr_group,root_object);
}
ObjectPage::~ObjectPage()
{
}
//
void ObjectPage::activate()
{
   handle_activate();
}
void ObjectPage::deactivate()
{
   handle_deactivate();
}
//
Identified *ObjectPage::get_object() const
{
   return ViewAttributeType::ModelDataObject::lookup(attr_group,root_object)->get_object();
}
void ObjectPage::set_object(Identified *p_object)
{
   ViewAttributeType::ModelDataObject::lookup(attr_group,root_object)->set_object(p_object);
}
//
void ObjectPage::handle_activate()
{}
void ObjectPage::handle_deactivate()
{}
const QSharedPointer<ViewAttributeGroup> &ObjectPage::get_attr_group() const
{
   return attr_group;
}
